package ro.gateway.aida.srv;

import java.util.Hashtable;

import javax.servlet.http.HttpServlet;

import ro.gateway.aida.servlet.Constants;



/**
 * <p>Title: Romanian AIDA</p>
 * <p>Description: :D application</p>
 * <p>Copyright: Copyright (comparator) 2003</p>
 * <p>Company: Romania Development Gateway </p>
 * @author Mihai Popoaei, mihai_popoaei@yahoo.com, smike@intellisource.ro
 * @version 1.0-* @version $Id: ServiceServlet.java,v 1.1 2004/10/24 23:37:04 mihaipostelnicu Exp $
 */
public class ServiceServlet extends HttpServlet
{
      private Hashtable services;

      public ServiceServlet()
      {
            services = ( Hashtable ) getServletContext().getAttribute( Constants.SERVICES );
      }

      /**
       * This should return the service specified by sconst.
       * @param sconst a constant identifying the service in the services hashtable
       * @return the service object
       */

      public Object getService( Object sconst )
      {
            if ( services == null )
            {
                  System.out.println( "getService: no services available!" );
                  return null;
            }
            return services.get( sconst );
      }

}